import React, { Component } from "react";
import { withRouter } from "react-router-dom";
import "./index.less";

@withRouter
export default class InformationList extends Component {
  state = {
    informationList: [
      {
        id: 0,
        fileType: 1,
        filename: "01-销售-泛微全程数字化运营平台解决方案.pptx",
      },
      {
        id: 1,
        fileType: 0,
        filename: "02-销售-泛微全程数字化运营平台演示脚本（有图版）.docx",
      },
      {
        id: 2,
        fileType: 0,
        filename: "03-销售-泛微全程数字化运营平台演示脚本（有图版）.docx",
      },
      {
        id: 3,
        fileType: 1,
        filename: "04-销售-泛微智能化亮点与场景设计方案.pptx",
      },
      {
        id: 4,
        fileType: 0,
        filename: "05-销售-泛觉智能化场景演示脚本.docx",
      },
      {
        id: 5,
        fileType: 0,
        filename: "06-销售-泛微e-Buaider低代码平台关键功能亮点演示脚本.docx",
      },
      {
        id: 6,
        fileType: 1,
        filename: "07-销售-泛微e-Buaider低代码平台解决方案.pptx",
      },
      {
        id: 7,
        fileType: 0,
        filename: "08-销售-泛微e-Buaider低代码平台演示脚本（有图版）.docx",
      },
      {
        id: 8,
        fileType: 0,
        filename: "09-销售-泛微e-Buaider低代码平台演示脚本（有图版）.docx",
      },
    ],
  };

  componentDidMount() {
    document.title = "资料查看";
  }

  handleCardClick(item) {}

  render() {
    return (
      <div className="information-list">
        <div className="cards">
          {this.state.informationList.map((item) => {
            return (
              <div
                className="card"
                key={item.id}
                onClick={() => {
                  this.handleCardClick(item);
                }}
              >
                <div className="icon">
                  <img
                    src={
                      item.fileType == 0 ? "/images/word.png" : "images/ppt.png"
                    }
                  ></img>
                </div>
                <div className="filename">{item.filename}</div>
              </div>
            );
          })}
        </div>
      </div>
    );
  }
}
